package com.xianniu.ltc.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xianniu.ltc.model.po.*;
import com.xianniu.ltc.model.po.imports.ImportLeadPO;
import com.xianniu.ltc.model.vo.XnLeadVO;
import com.xxl.sso.core.entity.ReturnT;
import java.util.List;

/**
 * @author WangRuiJie
 * @Title: XnLeadService
 * @Package com.xianniu.ltc.service
 * @Description: 线索管理接口
 * @date 2021/5/314:58 下午
 */
public interface XnLeadService {

    IPage<XnLeadVO> selectLeadForAdmin(QueryLeadAdminPO po);

    XnLeadVO detailLeadForAdmin(String id);

    ReturnT transferLeadForAdmin(TransferLeadPO po);

    ReturnT deleteLeadForAdmin(List<String> idList);

    /**
     * 后台：线索回收站查询
     */
    IPage<XnLeadVO> selectLeadFallbackForAdmin(QueryLeadAdminPO po);

    /**
     * 后台：线索回收站还原
     */
    ReturnT resetLeadForAdmin(List<String> idList);

    /*************************************************************** 前台开始 ***************************************************************/

    /**
     * 公海查询线索
     * @param po
     * @return
     */
    IPage<XnLeadVO>  selectLeadForHighSea(QueryLeadHighSeaPO po);

    /**
     * 公海删除线索
     * @param id
     * @return
     */
    ReturnT deleteLeadForHighSea(String id);

    /**
     * 公海分配线索
     */
    ReturnT assignLeadForHighSea(AssignLeadPO po);

    /**
     * 公海领取线索
     */
    ReturnT receiveLeadForHighSea(List<String> ids);

    /**
     * 新增公海线索
     * @param po
     * @return
     */
    ReturnT addLeadForHighSea(AddXnLeadPO po);

    /**
     * 公海查询线索
     * @param po
     * @return
     */
    IPage<XnLeadVO> selectLeadForPrivateSea(QueryLeadHighSeaPO po);

    /**
     * 新增私海线索
     * @param po
     * @return
     */
    ReturnT addLeadForPrivateSea(AddXnLeadPO po);

    /**
     * 私海放回线索池
     */
    ReturnT putBackLeadForPrivateSea(PutLeadPO po);

    /**
     * 强制回收线索到线索池
     */
    ReturnT recycleLeadForPrivateSea(PutLeadPO po);

    /**
     * 保存导入的线索数据
     * @param excelList
     * @param tenantCode
     * @return
     */
    Integer saveImportLead(List<ImportLeadPO> excelList, String tenantCode) throws Exception;

    /**
     * 线索管理：查询导出的线索数据
     * @param queryData
     * @return
     */
    List<XnLeadVO> selectExportLeadForAdmin(JSONObject queryData, Integer dr);


}
